function addCustomer(){
	var timeutil = new timeUtil();
	this.add=function(){
		var name = $("#name").val();
		var age = $("#age").val();
		var sal = $("#sal").val();
		var sex = $("input[name='sex']:checked").val();
		var birth = $("#birth").val();
		customer = {};
		customer.name=name;
		customer.age=age;
		customer.sal=sal;
		customer.sex=sex;
		customer.birth=birth;
		$.ajax({
			type:"POST",
			url:"addform",
			data:JSON.stringify(customer),
			contentType:"application/json"
		})
		.done(function(msg){
			$("#listtable").children().remove();
			var tr = ($("<tr>"));
	 		var td0 = ($("<td>")).text("ID")
	 		var td1 = ($("<td>")).text("NAME");
	 		var td2 = ($("<td>")).text("AGE");
	 		var td3 = ($("<td>")).text("SAL");
	 		var td4 = ($("<td>")).text("SEX");
	 		var td5 = ($("<td>")).text("生日");
	 		var td6 = ($("<td>")).text("删除");
	 		var td7 = ($("<td>")).text("修改");
	 		tr.append(td0).append(td1).append(td2).append(td3).append(td4).append(td5).append(td6).append(td7);
	 		$("#listtable").append(tr);
			 if(msg.length!=0){
			 	msg.forEach((item)=>{
			 		var tr = ($("<tr>"));
			 		var td0 = ($("<td>")).text(item.id).val(item.id);
			 		var td1 = ($("<td>")).text(item.name);
			 		var td2 = ($("<td>")).text(item.age);
			 		var td3 = ($("<td>")).text(item.sal);
			 		var td4;
			 		if(item.sex){
			 			td4 = ($("<td>")).text("男");
			 		}
			 		else{
			 			td4 = ($("<td>")).text("女");
			 		}
			 		var td5 = ($("<td>")).text(timeutil.formatDateTime(item.birth));
			 		var btn = $("<button>").text("delete");
			 		var td6 = ($("<td>")).append(btn);
			 		btn.addClass("btn btn-danger");
			 		btn.on("click",function(){
			 		console.log("fsdf");
			 			var p = btn.parent().parent();
                        var c = p.children("td");
                        $.ajax({
                        	type:"POST",
                        	url:"delete",
                        	data:JSON.stringify({id:c.val()}),
                        	contentType:"application/json"
                        })
                        .done(function(msg1){
                        	btn.parent().parent().remove();
                        })
			 		})
			 		var btn2 = $("<button>").text("update");
			 		btn2.attr("uId",item.id).attr("data-toggle","modal").attr("data-target","#updateModel");
			 		btn2.addClass("btn btn-primary");
			 		var td7 = ($("<td>")).append(btn2);
			 		tr.append(td0).append(td1).append(td2).append(td3).append(td4).append(td5).append(td6).append(td7);
			 		$("#listtable").append(tr);
			 		$("#listtable").addClass("table table-bordered");
			 	})
			 }
		});
	}
}